<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>视频信息修改</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet"
	th:href="@{/manager/layui/lib/layui-v2.5.5/css/layui.css}"
	href="../../lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" th:href="@{/manager/layui/css/public.css}"
	href="../../css/public.css" media="all">

<style>
body {
	background-color: #ffffff;
}

.ke-v-tab-controle-btn.ossFile-not-allowed>a:hover {
	cursor: not-allowed;
	color: #8EADC3;
}
</style>
</head>
<body>
	<div class="layui-form layuimini-form">
		
		<input type="hidden" name="id" th:value="${videomediapo.id}">
		<div class="layui-form-item">
			<label class="layui-form-label required">视频分类</label>
			<div class="layui-input-inline">
				<input type="text" lay-verify="required" id="parentvalue"
					readonly="readonly" placeholder="请选择分类" class="layui-input"
					th:value="${videomediapo.cate.categoryname}"> <input
					type="hidden" name="categoryid" id="parentId"
					th:value="${videomediapo.cate.id}">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label required">媒体名称</label>
			<div class="layui-input-inline">
				<input type="text" lay-verify="required" placeholder="请媒体名称" name="mediaorginalname"
					class="layui-input" th:value="${videomediapo.mediaorginalname}">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">媒体类型</label>
			<div class="layui-input-inline">
				<input type="radio" name="mediatype" value="1" title="视频"
					checked="checked" th:if="${videomediapo.mediatype==true}">
				<input type="radio" name="mediatype" value="2" title="音频"
					checked="checked" th:if="${videomediapo.mediatype==false}">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">媒体</label>
			<div class="layui-input-inline"
				th:if="${videomediapo.mediatype==true}">
				<video controls="controls" style="width: 700px;">
					<source th:src="@{${videomediapo.mediaorginalpath}}"
						type="video/mp4">
				</video>
			</div>
			<div class="layui-input-inline"
				th:if="${videomediapo.mediatype==false}">
				<audio th:src="@{${videomediapo.mediaorginalpath}}">
				</audio>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn layui-btn-normal" lay-submit
					lay-filter="saveBtn">确认保存</button>
			</div>
		</div>

	</div>
	<!-- 	</form> -->
	<script th:src="@{/manager/layui/lib/layui-v2.5.5/layui.js}"
		src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
	<script type="text/javascript"
		th:src="@{/manager/js/jquery-1.8.3.min.js}"></script>
	<script type="text/javascript" th:src="@{/manager/js/crypto.js}"></script>
	<script type="text/javascript" th:src="@{/manager/js/base64.js}"></script>
	<script type="text/javascript" src="../js/plupload.full.min.js"
		th:src="@{/manager/plupload/js/plupload.full.min.js}"></script>
	<script type="text/javascript" th:src="@{/manager/js/upload.js}"></script>
	<script>
		layui.use([ 'form', 'element' ], function() {
			var form = layui.form, layer = layui.layer, $ = layui.$;
			var element = layui.element;

			$("#parentvalue").click(function() {
				layer.open({
					title : '选择视频分类',
					type : 2,
					shade : 0.2,
					maxmin : true,
					shadeClose : true,
					area : [ '30%', '50%' ],
					content : '/videocate/totreelist',
				});
			});
			
			//监听提交
			form.on('submit(saveBtn)', function(data) {
				$.ajax({
					url : '/video/add',
					data : data.field,
					dataType : "json",
					type:"post",
					success : function(result) {
						layer.alert("操作成功", function() {
							parent.window.location.reload();
						})

					}
				});

				return false;
			});

		});
	</script>
</body>
</html>